package com.mccken.designpattern.proxy.jdkProxy;

import java.lang.reflect.Proxy;

/**
 * @program: mccken-collect
 * @description:
 * @author: mccken
 * @create: 2022-10-27 10:43
 **/
public class McckenServiceProxy {

	public static Object createProxy(ITarget1 target1) {
		Class<?>[] interfaces = McckenService.class.getInterfaces();
		ClassLoader classLoader = McckenService.class.getClassLoader();
		return Proxy.newProxyInstance(classLoader, interfaces, new McckenServiceDynamicProxyHandler(target1));
	}
}
